unit hsLocating;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls;

type
  TOnTerminate = function: boolean of object;
  TfrmLocating = class(TForm)
    pnlMessage: TPanel;
    btnTerminate: TButton;
    procedure btnTerminateClick(Sender: TObject);
  private
    { Private declarations }
    FOnTerminate: TOnTerminate;
  public
    { Public declarations }
    property OnTerminate: TOnTerminate read FOnTerminate write FOnTerminate;
  end;

implementation

{$R *.DFM}

procedure TfrmLocating.btnTerminateClick(Sender: TObject);
begin
  if (NOT Assigned(FOnTerminate)) OR FOnTerminate then
    begin
    ModalResult:=mrCancel;
    Close;
    end;
end;

end.
